﻿using System;

namespace ExtensionMethods
{
    internal class Program
    {
        public static void Main(string[] args)
        {
            // ExtensionMethods
            Product p = new Product() { Cost = 1000, DiscountPercentage = 10 };
            Console.WriteLine(p.GetDiscount());


            // Pattern Matching
            // reference variable of parent class
            ParentClass pc;
            // object of child class
            pc = new ChildClass() { x = 10, y = 20 };
            // access parent class's members
            if (pc is ChildClass cc)
            {
                Console.WriteLine(cc.x);
                Console.WriteLine(cc.y);
            }

            // Implicitly-Typed Variables:declared with 'var' keyword
            var Age = 12;
            var Name = "castle";
            
            // Dynamically-Typed Variables
            dynamic x;
           
            x = 12;
            x = "hello";
            x = new Student(){StudentName = "Castle"};
            Console.WriteLine(x.StudentName as String);
            
            // Inner Class
            MakrsCalculation.CalculationHelper ch = new MakrsCalculation.CalculationHelper();
            // call the inner class's method
            Console.WriteLine(ch.Multiply(9, 3));
            
            
            Console.ReadKey();
        }
    }
}